package com.house.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.house.common.utils.PageUtils;
import com.house.common.utils.Query;
import com.house.system.dao.RegionalDao;
import com.house.system.dao.SchoolDao;
import com.house.system.entity.TbArea;
import com.house.system.entity.TbAreasystem;
import com.house.system.entity.TbSchool;
import com.house.system.service.RegionalService;
import com.house.system.service.SchoolService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("SchoolService")
public class SchoolServiceImpl extends ServiceImpl<SchoolDao, TbSchool> implements SchoolService {
    private  final SchoolDao schoolDao;

    public SchoolServiceImpl(SchoolDao schoolDao) {
        this.schoolDao = schoolDao;
    }


    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TbSchool> page = this.page(
                new Query<TbSchool>().getPage(params),
                new QueryWrapper<TbSchool>()
        );
        return new PageUtils(page);
    }

    @Override
    public List<TbArea> findlist(Integer cid) {
        return schoolDao.findlist(cid);
    }

    @Override
    public void removeByIds(Integer id) {
        schoolDao.removeByIds(id);
    }

    @Override
    public void saves(TbSchool tbSchool) {
        schoolDao.saves(tbSchool);
    }

    @Override
    public void updateByIds(TbSchool tbSchool) {
        schoolDao.updateByIds(tbSchool);
    }


}
